package com.kadron.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.kadron.base.KTSBase;
import com.kadron.datamodel.KModel;

@Entity
@Table(name = "k_news")
public class News extends KTSBase implements Serializable,KModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3977302458005424601L;
	
	protected Date start;
	protected Date end;
	protected boolean active;
	
	public News() {
		super();
	}
	
	public News(Date start, Date end, boolean active) {
		this();
		this.start = start;
		this.end = end;
		this.active = active;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start")
	public Date getStart() {
		return start;
	}

	public void setStart(Date start) {
		this.start = start;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end")
	public Date getEnd() {
		return end;
	}

	public void setEnd(Date end) {
		this.end = end;
	}

	@Column(name = "active")
	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		News other = (News) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
}
